package cn.share.life.module.images.utils;

import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

@Slf4j
public class JsoupUtils {

    public static Document getDocument(String url) {
        try {
            ImageFileUtils.disableSSLVerification();
            return Jsoup.connect(url)
                    .userAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; MALC)")
                    .get();
        } catch (IOException e) {
            log.error("getDocument异常，url={}", url, e);
        }
        return null;
    }
}
